Store PRegSet in MachineEnv#254
Conversation
Helps to make the `MachineEnv`s in Wasmtime `const`-allocatable.
cfallin
left a comment
There was a problem hiding this comment.
Thanks a bunch for working on this!
Use `offset_hint` as a mask start rather than looking for the Nth bit set. Should in theory have the same overall desired balancing semantics but enables more bit-tricks.
cfallin
left a comment
There was a problem hiding this comment.
Thanks! Test tweak but otherwise LGTM.
src/lib.rs
Outdated
| let p0 = PReg::new(0, Int); | ||
| let p1 = PReg::new(1, Int); | ||
| let p2 = PReg::new(2, Int); | ||
| let p3 = PReg::new(3, Int); |
There was a problem hiding this comment.
Can we tweak these test values to exist in the various limbs?
64 regs per class, and class is put in the upper bits, and limbs are 64 bits each, so maybe something like (0, Int), (5, Float), (23, Vector), (63, Vector) or something like that?
There was a problem hiding this comment.
Good point! Pushed up with some more tests, but if you're thinking of other kinds of tests I'm happy to add more too
|
If you want to do a version-bump PR (this is a semver break so 0.14.0 would be next) I'm happy to merge and then do a release (over here in RA2-land I just |
…nts. As part of updating Cranelift to use the new const-fn-friendly MachineEnv changes in bytecodealliance#254, I found I needed a few more bits here. In particular the `from_bits` method duplicates a `From` impl, but `From::from` is not a `const fn`, so we can't use it. A little awkward but this replicates what we've done elsewhere.
…nts. (#255) As part of updating Cranelift to use the new const-fn-friendly MachineEnv changes in #254, I found I needed a few more bits here. In particular the `from_bits` method duplicates a `From` impl, but `From::from` is not a `const fn`, so we can't use it. A little awkward but this replicates what we've done elsewhere.
Helps to make the
MachineEnvs in Wasmtimeconst-allocatable.Closes #252